﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

# pragma execution_character_set("utf-8")

#include <QMainWindow>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QTextCodec>
#include <QNetworkInterface>
#include <QUdpSocket>
#include <QTcpServer>
#include <QTcpSocket>
#include <QNetworkDatagram>
#include <QMessageBox>
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButton_OpenSerialPort_clicked();

    void on_pushButton_SerialportSend_clicked();

    void on_pushButton_NetSend_clicked();

	void on_pushButton_OpenNet_clicked();
private:
    Ui::MainWindow *ui;
private:
	QSerialPort m_SerialPort;
	QTcpServer m_TcpServer;
	QUdpSocket m_UdpSocket;
	QTcpSocket m_TcpSocket;
	QTimer m_UpdateTimer;
	void CloseAllNet();
private slots:
	void slot_DealUpdateTimer();
};

#endif // MAINWINDOW_H
